from urllib.request import urlopen
from urllib.error import HTTPError
#from bs4 import BeautifulSoup
from urllib.error import URLError

try:
    html=urlopen('http://1pythonscraping.com/pages/page1.html')
except HTTPError as e:
    print(e)
except URLError as e:
    print('the server could not be found')
else:
    # bs=BeautifulSoup(html.read(),'html.parser')
    # print(bs.h1)
    print('It worked!')
